package com.applet.service.impl;

import com.applet.common.constant.StateConstant;
import com.applet.common.context.BaseContext;
import com.applet.mapper.AppCreationMapper;
import com.applet.pojo.dto.AppCreationDTO;
import com.applet.pojo.entity.AppCreation;
import com.applet.service.AppCreationService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author fff
* @description 针对表【app_creation】的数据库操作Service实现
* @createDate 2024-12-19 17:24:13
*/
@Service
public class AppCreationServiceImpl extends ServiceImpl<AppCreationMapper, AppCreation>
    implements AppCreationService{

    @Autowired
    private AppCreationMapper creationMapper;

    @Override
    public void saveOrUpload(String id, AppCreationDTO creationDTO) {

        AppCreation appCreation = new AppCreation();
        appCreation.setActivityId(id);
        appCreation.setCreationUrl(creationDTO.getCreationUrl());
        appCreation.setDescription(creationDTO.getDescription());
        appCreation.setDeleted(StateConstant.ENABLE);
        appCreation.setUserId(BaseContext.getCurrentId());
        creationMapper.insert(appCreation);
    }
}




